package comxin.demo1.nodestream;

import org.junit.Test;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

public class InpuStreamDemo {
    @Test
    public void  method(){
        File file = new File("D:\\javaee\\javase\\IO\\src\\comxin\\demo1\\nodestream\\InpuStreamDemo.java");
        try {
            InputStream fileInputStream = new FileInputStream(file);
            byte[] bytes = new byte[100];
            int n=-1;
            while ((n=fileInputStream.read(bytes,0,bytes.length))!=-1){
                System.out.println(new String(bytes,0,n));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
